<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="org.swimv2.entities.*" %>
<%@ page import="java.util.List" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<% User curr_u = (User) request.getSession().getAttribute("user"); %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
@import url(/WEBswim2/css/main.css);
</style>
	<title>SWIMv2 Home Page</title>
</head>

<body>

<p>&nbsp;</p>

<p align="center"><img src="/WEBswim2/css/logo.jpeg" /></p>

<h1 align="center">SWIMv2 Home Page</h1>

<%
    String msg = (String) request.getAttribute("message");
    if (msg != null) {
        out.println("<p class=\"message\">"+ msg +"</p>");
    }
    String err = (String) request.getAttribute("error_message");
    if (err != null) {
        out.println("<p class=\"error_message\">"+ err +"</p>");
    }
%>

<p>&nbsp;</p>

<p align="center">
<a href="/WEBswim2/SearchUsers"><strong>Ricerca Utenti</strong></a> (per nome o per competenza)
</p>

<p>&nbsp;</p>

<% if (curr_u == null) { %>

<ul class="ul_nav">
    <li><a href='/WEBswim2/access/login.jsp'>Login</a></li>
    <li><a href='/WEBswim2/access/signup.jsp'>Sign Up</a></li>
</ul>

<% } else { %>

<ul class="ul_nav">
    <li><a href="/WEBswim2/user/profile.jsp">Il Mio Profilo</a> <em>[<% out.print(curr_u.getFirstName() +" "+ curr_u.getLastName()); %>]</em></li>
    <% if (curr_u.getIsAdmin()) { %><li><a href="/WEBswim2/admin/profile.jsp">Il tuo profilo di Amministratore</a></li><% } %>
    <li><a href="/WEBswim2/Logout">Logout</a></li>
</ul>

<% } %>
	
</body>
</html>